#include<bits/stdc++.h>
using namespace std;
int main()
{
	double s = 0, n;
	int f = 1;
	cin>>n;
	for(int i = 1;;i++)
	{
		f = i%3 == 0 ? -1 : 1;
		double t = 1.0/i*f;
		if(fabs(t) < n)
			break;
		s += t;
	}
	cout<<fixed<<setprecision(4)<<s;
	return 0;
}

